package com.msb.serviceorder.generator;

/**
 * @Auther: jiudianliu
 * @Date: 2023/7/17 - 07 - 17 - 16:07
 * @Description: com.msb.serviceorder.generator
 * @version: 1.0
 */

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

/**
 * 自动生成实体类工具
 */
public class MySqlOrderGenerator {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://localhost:3306/service-order?characterEncoding=utf-8&serverTimezone=GMT%2B8",
                "root","root")
                .globalConfig(builder -> {
                    builder.author("jiudianliu").fileOverride().outputDir("Z:\\000_m\\Java\\online-taxi-public\\online-taxi-2023-public\\online-taxi-public\\service-order\\src\\main\\java");
                })
                .packageConfig(builder -> {
                    builder.parent("com.msb.serviceorder").pathInfo(Collections.singletonMap(OutputFile.mapperXml,
                            "Z:\\000_m\\Java\\online-taxi-public\\online-taxi-2023-public\\online-taxi-public\\service-order\\src\\main\\java\\com\\msb\\serviceorder\\mapper"));
                })
                .strategyConfig(builder -> {
                    builder.addInclude("order_info");
                })
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
    }
